﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ThoiTrang.Business;
using ThoiTrang.Entities;
using ThoiTrang.Data;
using System.Text;

public partial class adm_docs : System.Web.UI.Page
{
    #region "Page functions"

    public string ckid = "";

    private void _BindGreeting()
    {
        a_User au=a_UserService.Geta_User(Request.Params["ckid"]);
        if (au != null)
        {
            this.lblGretting.Text = "Hi " + au.Firstname + " " + au.Lastname;
        }
    }
    #endregion

    #region "Event"
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this._BindGreeting();
            this._BindData();
        }
    }

    private void _BindData()
    {
        a_Doc ad = a_DocService.Geta_Doc(1);
        this.txtBodyVN.Text = ad.PSEmailMes;
    }

    protected void btnCommit_Click(object sender, EventArgs e)
    {
        a_Doc ad = a_DocService.Geta_Doc(1);
        if (ad != null)
        {
            ad.PSEmailMes = this.txtBodyVN.Text;
            a_DocService.Updatea_Doc(ad);
            CommonFunc.ShowAlertMessage(this.lblAlert, "Update doc sucessfully");
        }
    }
    #endregion 
    
}
